//
//  z_DateTime.h
//  Template
//
//  Created by zhoubl on 13-6-3.
//  Copyright (c) 2013年 cdeledu. All rights reserved.
//

#import "z_Precompile.h"

@interface z_DateTime : NSObject

/*时间处理*/
+ (NSString *)encodeTime:(NSDate *)date;                                    //转换NSDate格式为字符串"yyyy-MM-dd HH:mm:ss"
+ (NSDate *)dencodeTime:(NSString *)dateString;                             //转换字符串为"yyyy-MM-dd HH:mm:ss"格式到NSDate
+ (NSDate *)dencodeTime2:(NSString *)dateString;            
+ (NSString *)encodeTime:(NSDate *)date format:(NSString *)format;          //装换NSDate格式到NString
+ (NSDate *)dencodeTime:(NSString *)dateString format:(NSString *)format;   //转换NString到NSdate
+ (NSString *)timeSinceNow:(NSDate *)date;                                  //从现在到某天的时间
+ (NSString *)timeSinceNow2:(NSDate *)date;

+ (NSString *)week;

+(NSString *) day;

+ (NSString *)nextMonthOfDate:(NSDate *)date forward:(BOOL)forward;
+ (NSInteger)indexOfWeekAtDate:(NSDate *)date;                              //对应日期是周几的index  周日：7，周一：1，周二：2，周三：3，周四：4，周五：5，周六：6
+ (NSDate *)dateOffsetDays:(NSInteger)days fromDate:(NSDate *)date;         //对应日期偏移几天的日期  未来日期为正数，以前日期为负数
+ (BOOL)isSameOftheDate:(NSDate*)oneDate anotherDate:(NSDate*)anotherDate;  //判断两个日期是否为同一天
+ (BOOL)nowIsInFieldFrom:(NSDate*)fromDate to:(NSDate*)toDate;              //判断今天是否在两个日期方位内

/**
 *	判断时间大小
 *
 *	@param	theDate	<#theDate description#>
 *
 *	@return	<#return value description#>
 */
+ (int)intervalSinceNow: (NSString *) theDate;
@end
